BSD Unix sockets have been growing in popularity since their first appearance in 4.1cBSD Unix release for DEC VAX-11 in 1982. Today, sockets can be found in nearly all BSD derivatives and even in MS Windows. BSD sockets emulate file descriptors as an extension of the Unix file I/O system. Accordingly, you can call the standard library functions, such as read() and write(), to receive and transmit data. Since network communications requires more control than the file descriptor functions alone can provide, several new functions were added. For example, establishing a connection requires details about hosts, ports, protocols, and other options that simply cannot be expressed by open() alone. For a brief overview of BSD sockets, see "Programming with Sockets" by Marco Tomassini in the September 1991 issue of C Users Journal, Vol. 9, No. 9, pp. 39-56.
Socket++, by Gnanasekaran Swaminathan (Centreville, VA), is an iostream-like class for Unix and inet sockets, pipes, and socketpairs. Socket++ classes can be used more effectively than directly calling the underlying low-level system functions. Since Socket++ has the same interface as the LibG++ iostream (i.e. like cout and cin), it automatically performs type-safe input and output. Even though Socket++ is very easy to use, it still supports a full complement of socket options including: error reporting, debug mode, keepalives, routing, broadcast datagrams, out-of-band data, and buffer resizing. Socket++ includes a mechanism for handling timeouts gracefully as well. Socket++ runs on many Unix platforms including Sun Sparc, IBM RS/6000, DECstation, and SGI Indigo boxes. Socket++ version 1.4, released on 13-Jun-93, is now available as CUG Library volume #401.
Specifically, the following classes are provided:
sockbuf Class:: Socket streambuf class. sockAddr Class:: Base class for socket addresses. sockinetbuf Class:: Socket class for INET address family. sockinetaddr Class:: Address class for INET address family of sockets. sockunixbuf Class:: Socket class for UNIX address family. sockunixaddr Class:: Address class for UNIX address family of sockets. sockstream Classes:: I/O socket stream classes pipestream Classes:: I/O stream classes that provides pipe, socketpair, and popen facilities.
SGPC or "Simple Genetic Programming in C", by Walter Alden Tackett and Aviram Carmi, supports the "Adaptive Automatic Program Induction" method defined by Koza and Rice (Stanford University). The Koza and Rice method generates LISP programs designed to solve problems specified by the user. Tackett and Carmi have produced SGPC by porting the underlying algorithm for program creation from LISP to C. Thus, SGPC is a C program that generates LISP genetic programs as its output. Since SGPC is now available in C, it offers greater portability and a 25 to 50 times speed improvement, according to Tackett and Carmi. One notable improvement over the original is the ability to handle multiple populations. SGPC has been successfully built on many Unix workstations including Sun Sparcs, DECstations, HP-UX, and SGI Indigo. SGPC version 1.0 is now available as volume #401 in the CUG Library.
For a complete description of genetic methods see Genetic_Programming by John R. Koza (MIT Press, 1992). For other reading, Tackett delivered a paper entitled "Genetic Programming for Feature Discovery and Image Discrimination" for Genetic_Algorithms: Proceedings of the Fifth International Conference (GA93), S. Forrest Ed., Morgan-Kaufman 1993.
Problem definition takes place within three predefined files named setup.c, fitness.c, and prob.h. Since each problem uses the same filenames, you'll need to have a separate subdirectory for each problem. SGPC includes an example set to solve Koza's simple regression problem and the ADF problem with a simple 2-class dendritic classifier.
Specifically, setup.c contains function table and the functions it references as well as the terminals table. Next, prob.h must contain prototypes for the user defined functions. Last, fitness.c contains functions to evaluate and validate populations and trees, early termination, and definition of the fitness (training and test) cases.
CForms, by Lars Berntzon (Stockholm, Sweden), is a tool for building interactive forms-driven applications. CForms applications can run on any type of library supported by the "curses" library. CForms uses a language-based design to define forms. An application may contain C source modules, field pictures, field definitions, literals, and events. CForms applications must be compiled with the CFC compiler and linked with the CFL linker. CForms runs on most Unix SYSV compatible platforms including SunOS, Dell-SVR4, and Diab SYSV.3. It requires a curses library and yacc or GNU Bison. CForms version 2.1 is now available as volume #402 in the CUG Library.
A CForm application consists of modules containing "pictures" to handle the various functions in the application. A picture in turn consists of fields and text literals describing the appearance. Fields are named regions of the screen used for input and output. Fields have attributes for type, size, and event handling functions. Before creating a picture, you must first create a viewport. A viewport describes the width, height, and position on the real screen where the picture will appear.
You may specify field positions in absolute or relative coordinates. Alternately, you may ask to "center" on a particular row or column or use "max" to place it on the furthest row or column. CForms fields can be either numeric, character, or alphanumeric. Last, a field can have any combination of the following modifiers: protected (read-only), forbidden, uppercase, highlighted, and invisible.
CForms shows its flexibility and ease of operation best in its event handling. Each field can have special handling for any of the following events: "key", "refresh", "draw", "left", "entry", and "exit". CForms includes a library of more than 30 functions for handling the most common types of event processing. For example, the function fld_ismodified() will tell you if the user actually changed anything.
The "key" event allows you to intercept each keypress as the user types along in the field. CForms supports an extremely extensive set of keys including function keys, editing keys, numeric keypad function keys (e.g. SUN), and special purpose keys (e.g. HELP key). Many keys have separate shift-state identifications (e.g. shift-delete-char). However, control keys and alt keys are not supported.
Patrick KO Shu Pui (Tai Po, Hong Kong) contributes the Small Matrix Toolbox for C Programmers. The toolbox is a set of C functions for matrix creation, arithmetic, inversion, and solving linear equations. This product has been released as shareware. Although you may freely use it for academic purposes, commercial users must register with the author for $25. The Small Matrix Toolbox for C version 0.41 (released 09/23/93) is now immediately available as CUG volume #403.
The toolbox includes an abstract data type called MATRIX plus eighteen functions for manipulating MATRIX objects. Specifically, the toolbox supplies these functions, where "M" denotes a MATRIX object:
Toolbox Function Purpose ----------------------- -------------------------- M = mat_fill(M, type) Fill a matrix MatCol(M) Tell how many columns MatRow(M) Tell how many rows M = mat_colcopy1(M1, M2, j1, j2) Copy columns between matrices M = mat_copy(M ) Duplicate a matrix fgetmat(M, fileptr) Read matrix from an open file M = mat_dump(M) Write matri to stdout or file M = mat_add(M1, M2) M = M1 + M2 M = mat_mul(M1, M2) M = M1 * M2 M = mat_inv(M) Compute inverse matrix M = mat_tran(M) Find the transpose of matrix M = mat_submat(M, i, j) Create a submatrix by deleting row,col mat_cofact(M, i, j) Return cofactor of matrix[i,j] mat_minor(M, i, j) Return minor of matrix[i,j] mat_det(M) Return determinant of matrix M = mat_lsolve(M1, M2) Solve linear equation M1 * X = M2 M = mat_lsolve_durbin(M1, M2) Levinson-Durbin method M = mat_SymToeplz(M1) Create symmetric Toeplitz matrix
The algorithms themselves are well documented and referenced. KO draws from established computer science texts by Boas, Atkinson, Saito/Nakata, and Aho/Hopcroft/Ullman.
The Small Matrix Toolbox can be compiled on most Unix workstations as well as Borland C++ on MS-DOS. The toolbox provides makefiles for both Unix and MS-DOS environments.
Alain Co�tmeur of the Informatique-CDC (Arcueil, France) presents two new packages that bring traditional Unix tools into the 90's: Bison++ and Flex++. Coetmeur's Bison++ is derived directly from GNU Bison, the popular replacement for the Unix utility called YACC ("Yet Another Compiler Compiler"). Since its introduction two decades ago, the YACC software interface remains the most popular for developing compilers, assemblers, and other text processing applications. Any language that can be handled by a LALR(1) parser is a good candidate for YACC use.
Bison++ injects C++ classes into the established YACC software interface while retaining downward compatability with programs that use the older C interface. This both makes the YACC software interface much more attractive for new C++ applications and gives a definite migration path for older C applications. Bison++ version 1.21-7 (released 11/18/93) is immediately available as CUG #406. The version number decodes to revision 7 of Bison++ as integrated with GNU Bison 1.21.
Bison++ compiles on most Unix workstations and includes the ubiquitous GNU "configure" utility to generate appropriate makefiles for your workstation. Additionally, Bison++ claims compatability with Microsoft C++ (makefile included) and Borland Turbo C++ (makefile not included).
Since Bison++ is a superset of Bison, the archive includes complete Bison documentation as well. The documentation for Bison++ is provided in both GNU texinfo format and postscript. For information on Bison, on which Bison++ is based, see the following back issue:
Volkman, Victor. "Bison: A GNU Breed of YACC", C Users Journal, August 1989, p. 117.Co�tmeur's other contribution to the CUG Library is the Flex++ package. Like Bison++, Flex++ retains downward compatability with existing C programs while offering the benefits of C++ classes. Coetmeur's Flex++ is derived directly from GNU Flex ("Fast LEX"), the popular replacement for the Unix utility called LEX. Since its introduction two decades ago, the LEX software interface remains very popular for developing front-end lexical analyzers for YACC and standalone text processing applications. A LEX solution is ideal for matching both simple and complex patterns of characters.
Flex++ injects C++ classes into the established LEX software interface while retaining downward compatability with programs that use the older C interface. This both makes the LEX software interface much more attractive for new C++ applications and gives a definite migration path for older C applications. Flex++ version 2.3.8-6 (released 11/18/93) is immediately available as CUG #407. The version number decodes to revision 6 of Flex++ as integrated with GNU Flex 2.3.8.
Flex++ compiles on most Unix workstations and includes the ubiquitous GNU "configure" utility to generate appropriate makefiles for your workstation. Additionally, Flex++ claims compatability with Microsoft C++ (makefile included) and Borland Turbo C++ (makefile not included).
Since Flex++ is a superset of Flex, the archive includes complete Flex documentation as well. The documentation for Flex++ is provided in both GNU texinfo format and postscript. For information on Flex, on which Flex++ is based, see the following back issue:
Volkman, Victor. "Public Domain Lex is Fast and Flex-ible", October 1989, C Users Journal p. 129.
Mike Rejsa (Brooklyn Park, MN) submits his translator for converting ANSI-style C code and declarations to older Kernighan and Ritchie (K&R) syntax. Most C programmers have switched over to ANSI style coding techniques sometime in the last two or three years. The ANSI syntax allows for for more comfortably readable code and brings you closer to what you really wanted to write. For example, declaring parameters in the prototype and use of const, signed, and volatile storage class modifiers. However, in the course of maintaining older Unix systems, you may sooner or later have to handle the inelegant business of removing ANSI C specific constructs accurately from a newer source. ATOC version 1.08 (released 11/15/93) has been designated CUG 406A.
ATOC translates ANSI programs back to a K&R compiling source stream. The CUG distribution includes an MS-DOS executable (14K), but the ATOC source should compile easily on other platforms. ATOC itself is written in K&R C so that you may retarget ANSI C programs from older or newer platforms. Here's a short summary of command line options:
Usage: ATOC [-e] [-i] [-il] [-t] [-v] infile [ outfile ]Examples of usage:
ATOC file.c (convert and output to display) ATOC file.c out.c (convert and save) ATOC -v file.c out.c (convert and save with -v option)
The -e option will cause enumerations to be left alone. Some K&R compilers support enumerations.
The -i option will cause #include files to be included, converted, and placed in the output stream. Use ATOC without -i for simple one-time conversion, like if you have an ANSI program that you want to permanently convert to K&R style. Use ATOC with -i when you are maintaining ANSI code and wish to convert an included header 'on-the-fly' each time you recompile using your K&R compiler.
The -il option is just like -i except that only the local #include files (those whose name is in " " characters) are included and converted inline. If an #include files name is in < > characters, it is left as a normal #include statement. (These are often header files that come with the compiler, and as such would not be ANSI-C.)
The -t option will cause trigraphs to be left alone. (Note: If an older compiler supported trigraphs, they may not be ANSI-standard trigraphs and would therefore pass thru ATOC unchanged anyway.)
The -v option will cause voids to be left alone. Some K&R compilers support the void data type. (Note: A void used to indicate an empty function parameter list (e.g. int func( void ) ) is always removed, even when using the -v option.)
Also, Greg Jennings (Falmouth, MA) presents his MS-DOS DISK EDitor for low-level debugging and maintenance of floppy disks and hard disks. DISKED is a simple to use disk editor and data recovery program for IBM-PC/XT/AT and compatible computers. It allows the editing of any sector and the saving of sectors to a file. DISKED provides a way to recover data from disks with a damaged BOOT sector, damaged FATs, and damaged directory areas, allowing the saving of otherwise lost data. Jennings intends DISKED very easy to learn and to use. Commands have been abbreviated to as little as one letter for simplicity. DISKED version 2.5 (released 01/14/94) has been designated CUG #406B.
Although DISKED can recover an erased file's data, DISKED cannot unerase a file. DISKED also does not format nor change any parameters of the format of a disk, fix bad sectors, nor move files around. All DISKED does is read, write, and store any available sector of a disk in a simple and easy, yet powerful and versatile way.
DISKED starts at the root directory sector in a combined command and edit mode. You can navigate with arrow keys as if you were simply paging through a word processsing document. As you move, DISKED displays each sector encountered.
It maintains two available areas for data; a sector buffer that holds selected sector's data and a file buffer that allows saving sector data for writing to a disk file. The sector buffer can be edited bytewise with debugger type commands and then written back to the disk. DISKED provides a spare sector buffer to which a sector can be stored and retrieved for copying to another sector.
You may save data by appending single or multiple sectors into the file buffer. The file buffer can then be observed and changed, written to a disk file, emptied, or more sectors appended or unappended. Any number of absolute sectors can also be written to a file.
DISKED is written 100% in C and can be built in any Microsoft or Borland C compiler environment. Please note that DISKED is protected by the GNU Public License with additional amendments by Jennings.
PSUtils, by Angus Duggan (Edinburgh, Scotland), is an assortment of utilities for manipulating PostScript documents. Page selection and rearrangement are supported, including arrangement into signatures for booklet printing, and page merging for n-up printing. The complete collection of PSUtils Release 1-PL11 (June 1993) is now available as CUG library volume #407.
PSUtils have been commpiled and tested on Sun-3 and Sun-4 machines in every version of SunOS from 4.0.1 to 5.1 (Solaris 2.1). Other Unix configurations supported include HP 9000/375 machines under HPUX 7.0 and HPUX 8.0, Sequent Symmetry machines under Dynix 3.1.4 and PTX 3.2.0, and Decstation 3100 machines under Ultrix 4.0.
PSUtils is not a monolithic system, rather it is a collection of C programs, C shell scripts, and PERL scripts. Each utility has its own command-line interface and corresponding manual page. Briefly, the utilities are as follows:
Utility | Summary |
---|---|
psbook | rearranges pages into signatures |
psselect | selects pages and page ranges |
pstops | performs general page rearrangement and selection |
psnup | put multiple pages per physical sheet of paper |
epsffit | fits an EPSF file to a given bounding box |
getafm | outputs PostScript to retrieve AFM file from printer |
showchar | outputs PostScript to draw a character with metric info |
fixfmps | filter to fix framemaker documents so that psselect etc. work |
fixmacps | filter to fix Macintosh documents with saner version of md |
fixpsditps | filter to fix Transcript psdit documents to work with PSUtils |
fixpspps | filter to fix PSPrint PostScript so that psselect etc. work |
fixtpps | filter to fix Troff Tpscript documents |
fixwfwps | filter to fix Word for Windows documents for PSUtils |
fixwpps | filter to fix WordPerfect documents for PSUtils |
fixwwps | filter to fix Windows Write documents for PSUtils |
The PSUtils licensing scheme allows you to incorporate any parts of it into your own products. Your only obligations are to attribute them to the original author and provide information on how their original sources may be obtained.
'Simple NEWS' is an news add-on for UUPC/Extended v1.11n or later. It is designed to handle Usenet news as a leaf node, and offers:
Kendall Bennett of SciTech Software (Melbourne, Australia) submits his SuperVGA VESA VBE test kit and Universal VESA VBE. The SuperVGA VBE VESA test kit thoroughly tests and demonstrates the VBE BIOS calls. The Universal VESA VBE is a drop-in replacement for an existing VBE driver you might or might not already have. As you may recall, the Video Electronics Standards Association (VESA) has established criteria allowing interoperability of SuperVGA hardware and software. The VESA BIOS Extensions (VBE) provide the ability to address video modes beyond regular VGA (640x480x16) in a hardware-independent fashion. Although the test kit includes full source code, the shareware VBE replacement driver offers source code for an additional licensing fee from SciTech Software. Both are immediately available on a single diskette as CUG volume #409.
The SuperVGA Test Library is a set of routines for working with SuperVGA video cards that have a VESA VBE compliant Video BIOS. This library was an offshoot from the development of the Universal VESA VBE, which is an installable TSR to provide VESA VBE video BIOS extensions for most SuperVGA cards. It is intended to show how to program the SuperVGA cards through the VESA VBE and uses some of the more powerful features that the latest standard include in your own software. It was not designed with speed in mind, but more as an explanatory and exploratory tool.
This library supports many of the extended features of today's SuperVGA adapters, such as being able to separately set the read and write banks and support for extended page flipping. This is all done via the standard VESA VBE programming interface.
The SuperVGA test programs all call upon a single C library to access the SuperVGA using the VESA VBE programming interface. You can use this same library to provide SuperVGA support in your own applications, or you can take the source code for the library as a starting point and expanding on it from there.
You may already have a VESA VBE TSR for you video card, or you video card may have a VESA VBE compatible BIOS already, so why would you want to use this replacement TSR? The most TSRs, and especially those for older SuperVGAs, implement only v1.0 or 1.1 of the VESA VBE programming interface (if any at all). Accordingly, programs expecting to use advanced features of the new VESA VBE v1.2 standard will not work with the TSR or BIOS that you currently have.
So what advanced features does this TSR provide that other's don't? The Universal VESA VBE implements the VESA VBE 1.2 programming interface, which supports the following features:
The SuperVGA VBE test kit has few restrictions on use of the source code. The Universal VESA VBE is shareware and requires a $15 registration after a 21-day evaluation period. Source code for the Universal VESA VBE can purchased separately for $50.
For more information about VESA VBE, see some of my tutorials in these other R&D Publications journals:
Volkman, Victor R. "The VESA BIOS Extensions for SuperVGAs, Tech Specialist, December 1990, p. 12 (covers VBE v1.1)
Volkman, Victor R. "VESA's VGA BIOS Extension (VBE) Standard", Windows/DOS Developer's Journal, October 1992, p. 13 (covers VBE v1.2)
Gary A. Allen, Jr., (Prentice Center, Queensland, Australia) submits his PART utility for examining the partition table and hard disk parameters under MS-DOS. PART works with all MS-DOS compatible hard disks and provides additional low-level information on Integrated Drive Electronics (IDE) disk controllers. Allen notes that although there are powerful partition editors available, all of them run the risk of accidently changing these critical disk parameters. Since PART is a read-only display, the partition tables remain secure at all times. PART includes full source in C and claims compatability with the Borland C/C++ compiler. PART version 1.5, as released on 10/27/93, now appears on CUG #410.
Although PART is intended for use only with MS-DOS, you can still run the BIOS reporting functions under OS/2. However, you may not use the IDE controller interrogation functions in an OS/2 window. A typical PART display is shown in Fig. 1 below. If you have an IDE controller, you can also obtain several other vital statistics including model number, serial number, controller revision, 32-bit transfer compatability flag, controller type, controller buffer size, number of Error Correction Code (ECC) bytes transferred, and number of sectors processed on each interrupt.
������������������������������� FIG 1 ���������������������������������� --- Partition Table and Hard Disk Examination Program --- Program written by Gary A. Allen, Jr. Version: Mk 1.5 27 October 1993 (c) Copyright 1993 by Gary A. Allen, Jr. BIOS reports 820 cylinders, 6 heads (tracks) and 31 sectors/cylinder for a total (unformatted) capacity of 78090240 bytes. ������������������������������������������������������������������������������ͻ � Part �Type�Boot� Beginning � Ending �Starting �Number of� � Type �Code�Part�Side Cylinder Sector�Side Cylinder Sector� Sector � Sectors � ������������������������������������������������������������������������������ �DOSbig� 0x6� YES� 1 � 0 � 1 � 5 � 818 � 31 � 31 � 152303 � ������������������������������������������������������������������������������Ķ �Empty � 0� NO� 0 � 0 � 0 � 0 � 0 � 0 � 0 � 0 � ������������������������������������������������������������������������������Ķ �Empty � 0� NO� 0 � 0 � 0 � 0 � 0 � 0 � 0 � 0 � ������������������������������������������������������������������������������Ķ �Empty � 0� NO� 0 � 0 � 0 � 0 � 0 � 0 � 0 � 0 � ������������������������������������������������������������������������������ͼ "Part" has ended normally. If you are interested in more information about this program then type: part -h
William E. Hatch of Coleman Research Corporation (Greenbelt, MD) submits his C++ class library implementation of doubly linked lists. The wlist class is a doubly linked list that stores a generic pointer, void *, at each node. Pointers to functions which print and compare the objects pointed to at a node may be set within a wlist class instance. Subsequent use of the print or compare functions assumes that all of the nodes, within a wlist instance, point to the same type of object. The wlist class includes a self-testing program to verify functionality on your platform. The wlist class as released on 02/15/94 is now available on CUG #410
The pulic interface for the wlist class includes several useful operations:
Function Description -------- ----------------------------------------- wlist::wlist() constructor wlist:~wlist() destructor wlist::Size() return the number of list nodes wlist::DeleteAll() delete all list nodes, set size to zero wlist::Name() access and assign list name wlist::FirstData() access and assign data in first node wlist::LastData() access and assign data in last node wlist::CurrentData() access and assign data in current node wlist::NextData() access and assign data in next node wlist::PreviousData() access and assign data in previous node wlist::AppendData() creates new node with data and appends wlist::PrependData() creates new node with data and makes new head wlist::PreInsert() insert node with data before current node wlist::PostInsert() insert node with data after current node wlist::DeleteCurrent() deletes current node wlist::ExchangePrevious() swap data between current node and previous wlist::ExchangeNext() swap data between current node and next node wlist::Maximum() return node containing maximum data value wlist::Minimum() return node containing minimum data value wlist::Sort() create new list containing data sorted wlist::Reverse() reorder list from back to front wlist::Copy() duplicate copy of this list (level 1 copy) wlist::SetPrintData() stores pointer for later printing wlist::SetCompareData() stores pointer for later sorting wlist::print() debugging style dump of list
Bram Moolenaar (Venlo, Netherlands) contributes his Vi Improved editor (Vim) that supports MS-DOS, Amiga, and most forms of Unix. Vim claims near 100% of the functionality of the classic "vi" Unix editor. Vim also includes many embellishments on the original ideas and thus adds unique functionality of its own. The CUG Library edition includes full source in C as well as pre-built executables for MS-DOS. Vim version 2.0, as released 12/14/93, is now available as CUG #411.
Vim supplies extensive documentation in many forms including: a Unix man page, Unix man source file, quick reference card, platform-specific implementation notes, Vim and vi difference list, and an extensive 70 page ASCII reference manual. For those not familiar with vi's distinctive user interface, tutorial files are provided to get you up and running fast.
Vim's improvements are perhaps the best reason to try this innovative text editor. Here's an abbreviated list of some of Moolenaar's enhancements over the original vi:
Peter M. Bouthoorn (Groningen University, Netherlands) submits his C++ search class library with artificial intelligence capabilities. AISEARCH is a tool for developing problem solving software. Basically, the library offers the programmer a set of search algorithms that solve all kind of different problems. When developing problem solving software, the programmer should concentrate on the representation of the problem to be solved and should not the implementation of the search algorithm used. This AISEARCH implementation of a set of search classes may be incorporated in other software through C++ derivation and inheritance. AISEARCH can be built in MS-DOS with Borland C++ or MS C++ and on Unix using GNU C++. AISEARCH, as released on 02/10/94, is immediately available as CUG #412.
Specifically, AISEARCH implements the following search algorithms:
Using a search method in your own programs is just a matter of deriving a class from the desired search class and filling in the necessary parts. Turning the representation of the problem into actual source code is also made easier because the library demands that certain functions be used (these virtual functions are called by several routines in the search library), which helps standardizing this process.
Although this package is a tool for developing problem solving software, it is not just for programmers that are familiar with the concept of problem representation and search techniques. The document accompanying this package briefly describes the theory of problem solving in AI and explains how to use the search class library. Since it includes richly commented source code and demo programs, it is useful to people that want to get acquainted with the subject.
CUG proudly announces two freeware programming kits for the Sound Blaster digital audio cards on a single diskette volume. The original Sound Blaster card by Creative Labs, Inc. has become the industry standard for PC digital audio. Today, a plethora of Sound Blaster (SB) compatible cards are available from many vendors. Although SB cards have proliferated widely, the knowledge required to program and control their operation has not. The I/O and DMA access protocol is critical for developers creating MS-DOS based applications with SB audio.
David Welch (Las Cruces, NM) contributes his collection of Sound Blaster Tools in C (CUG #413A). He provides highly detailed information and C code in Borland Turbo C for a variety of audio mini applications. Sound Blaster Tools version 4 (released 12/11/93) is now available on CUG #413.
These tools provide a programming specification for the Sound Blaster and Sound Blaster Pro (DSP DAC/ADC only). As a bonus, it also provides some information and C code on programming for the PC Speaker. Since the source is code intended to be a basic example, high speed ADC/DAC is not demonstrated. All examples use DMA channel 1 and I/O base adddress 220h. Accordingly, source may need slight modification to work on your PC. The CUG Library distribution includes precompiled versions of all executables. Specifically, Sound Blaster Tools builds the following MS-DOS mini applications.
Additionally, it includes programming specifications for various chips available to all PC compatables: 8259 Programmable Interrupt Controller, 8254 Programmable Interrupt Time, 8237 DMA Controller, and others.
Jeffrey Bird, Dept. of Electrical and Computer Engineering at the James Cook University of North Queensland (Townsville, Australia), contributes his Sound Blaster Freedom Project (SBFP). As moderator of the SBFP, he has collected an impressive array of technical information. Bird writes:
"The aim of the Sound Blaster Freedom Project is to provide a cheap source of programming information for the Sound Blaster and other sound cards. Previously, programming a sound card has required a not inconsiderable investment in a developer's kit for each sound card. These developer's kits have been known to be terse and not well written. Our aim is to provide enough information to the general programmer to allow them to add sound card support to their software at minimal cost."
SBFP includes source code in C and assembler for these DOS mini-applications:
Additionally, SBFP includes technical documents on programming the FM Music synthesizer chips, 8237 DMA Controller, and Sound Blaster voice file format (.VOC).
SBFP version 3.0 (released 01/25/94) is now available on CUG #413. This version includes significant enhancements by Christopher M. Box, some of which are:
Mark Hessling (Holland Park, Queensland, Australia) offers his own full screen text editor similar to IBM VM/CMS Xedit and Mansfield Software's KEDIT. The THE text editor uses both command line commands and key bindings to operate. It has currently been ported to SUNOS 4.1.x, Xenix-386, MS-DOS (Borland C++ and MSC), Esix 4.0.3a, ATT SystemV 3.2, Linux, 386BSD, and OS/2 2.1 (MSC, C Set/2, Borland C++). The CUG distribution of THE includes full source in C and a prebuilt executable for use with MS-DOS. THE version 1.5, as released on 01/12/93, is now available as CUG #414.
THE includes extensive documentation in the form of a 70 page ASCII Command Reference manual. In encylopaedic fashion, it describes each command along with its syntax, compatability with XEDIT and KEDIT, implementation status, and pointers to related commands.
THE makes use of the powerful IBM VM/CMS REXX command language in any environment where it is available. THE uses the OS/2 REXX interpreter to execute macro files. An extensive interface exists between THE and REXX giving THE the complete power of REXX. REXX support is also avaliable on Unix systems and with DJGPP using Regina 0.05, a free REXX interpreter available from flipper.pvv.unit.no in pub/rexx. Details on integrating THE and Regina are included in the makefile.
Arindam Banerji (Dept. of Computer Sci. & Eng, University of Notre Dame) contributes his Run Time Type Information library for C++. Run Time Type Information (RTTI) is a C++ language extension proposed by the ANSI C++ committee. Although the extension is intended to implemented as part of native C++ compilers, it may be a long time before this comes to fruition. Fortunately, Banerji's implementation of RTTI as a C++ library means that you can start taking advantage of it right away. His system is loosely based on the RTTI system demonstrated by Stousroup in "The C++ Programming Language". RTTI for C++ works *ONLY* with Unix based C++ implementations due to file naming conventions that are *INCOMPATIBLE* with MS-DOS. RTTI for C++, as released on 11/03/93, is now available is CUG #414.
All classes in this RTTI system inherit from the CLASS base class. This allows public virtual inheritance to work. CLASS has very little functionality associated with it, although it itself has the RTTI scaffoldings neccessary for all users of RTTI. The narrowing facility (i.e. going from a base class pointer to a derived class pointer) depends upon the use of CLASS.
The Type_info class is the core of the RTTI implementation. It is initialized once, per class. The constructors accept a list of the base classes and the name of the class. The typeid class provides an interface to the RTTI system and users get at the RTTI thru this class. This class just acts like a pass thru for the Type_info class.
The base_iterator class is initialized with the list of base classes. It allows the clients of the Type_info class to iterate thru the list of bases. RTTI also includes demonstration code for "string" and "trace" classes.
Every class that uses the RTTI must use some scaffolding in both the declaration and the definition of the class. The declaration must contain the following:
virtual typeid get_info() const ; static typeid info() ;
static Type_info *_narrow(CLASS *) ;
virtual void *get_this_ptr(void) const ;
Nigel Salt (Crayford, Kent, U.K.) contributes a variety of standalone tools and libraries with source code in C for MS-DOS. This is the first time source code for many of these tools has been released. Some of the programs are written specifically for Borland Turbo C while others are intended for use with Microsoft C (MSC). All programs are shareware with reasonable registration fees ($15 or less) or donationware (whatever you feel is appropriate). The CUG Library distribution includes the following programs in both source and executable format:
Oleg Orel (Institute for High Energy Physics, Protvino, Russia) presents his LIBFTP TCP/IP library. LIBFTP provides an easy callable interface for Unix programs to talk with FTP servers as defined in RFC 959. The FTP (or File Transfer Protocol) is the protocol of choice for transferring files over the Internet. As such, you could use this library to write your own FTP client with a graphical user-interface or perhaps as the basis of a file-mirroring utility. LIBFTP works with most popular Unix systems but cannot work with MS-DOS. LIBFTP (as released on 10/28/93) is immediately available as CUG #417.
A full suite of functions provides the ability to have multiple FTP channels open simultaneously. A stream level interface allows for reading and writing using many popular stream functions, such as fgetc(). Additionally, you can ask for directories to be created on the FTP server as well as both sending and receiving files.
LIBFTP includes a 10 page "User's Guide" describing each of the function calls available. The documentation is provided in both English and Russian language versions. Each appears in both TEX and Postscript printable format.
LIBFTP provides two very small examples that can be used to check out the library. FCP.C demonstrates copying a file between two FTP servers in stream mode (WITHOUT opening intermediate files). GET.C uses a simple command-line interface to fetch a single file and then hangup the FTP connection. All C source code is provided with this distribution. You can use the GNU C compiler or any compatible ANSI C compiler.
Roger Sayle (Dept. Computer Science, University of Edinburgh, U.K.) contributes his molecular graphics visualization system for Unix XWindows and MS Windows. Specifically, RasMol is intended for the visualisation of proteins and nucleic acids. It reads Brookhaven Protein Databank (PDB) files and interactively renders them in a variety of formats on either an 8-bit (see Fig. 2) or 24- to 32-bit colour display. Documentation includes include on-line help, hypertext documentation and the previous (dated) version of the PostScript user reference manual. RasMol version 2.3 (as released on 03/04/94) is immediately available on a 4 disk set as CUG #418.
RasMol is intended for teaching and generating publication quality images. The program has both a menu system and a full featured command line interface. Different parts and representations of the molecule may be coloured or displayed in a number of formats independently. Currently supported formats include wireframe, ball and stick, backbone, space filling spheres and solid or strands ribbon models. The space filling spheres may even be shadowed. The molecule may be manipulated using the mouse, the scroll bars, the interactive command line or from a dials box (if one is attached). The resulting image may be saved at any point in PostScript, GIF, PPM, Sun rasterfile or Microsoft BMP formats. On a SparcStation, it can shadow a 10,000 atom spacefilling protein in less than 10 seconds.
The current version of the program has been tested on sun3, sun4, sun386i, SGI, DEC & E&S mips based machines, DEC Alpha (OSF/1 and OpenVMS), VAX VMS (under Dec Windows), IBM RS/6000, hp9000, sequent compiled under both gcc and (typically) the native compiler. The version for Microsoft Windows requires version 7 of the Microsoft Optimizing C Compiler or Visual C++ Compiler and the Microsoft Software Development Kit (SDK).
The source code is public domain and freely distributable provided that the original author is suitably acknowledged. Although no formal registration is required, the author suggests a donation of $40 in U.S. currency or 25 pounds British currency for those who "appreciate the large amount of work that went into RasMol".
Dale Anderson (San Diego, CA) submits his a first release of the collections specified by Object Database Management Group - 93 (ODMG-93). This work is based on the publication "The Object Database Standard: ODMG-93" (ISBN 1-55860-302-6). Although Anderson has no personal affiliation with the ODMG, this work nevertheless represents an important contribution to the dissemination of this conceptual model. His release contains collection classes (see chapter 5), man pages for each method, and a test suite for almost all methods. The code itself has been tested on an HP/UX 9.0 C++ compiler and GNU C++ also on this platform. Anderson's ODMG-93 implementation for Unix (as released on 03/02/94) is immediately available as CUG volume #419.
This implementation does not include a mechanism for persistent objects. Rather, he intends this to be the "front end" of the specification so that software developed today can easily integrate with an object-oriented database (OODB) in the future. Since the ODMG-93 specification intends to be independent of OODB implementations, no back end database will appear in this implementation. Additionally, this implementation does not include an SQL parser, though such may eventually be released.
Anderson's short term goal is to vevelop a working model of the ODMG-93 class library that is as near 100% compliance as possible. This model then becomes a tool to compare and contrast with the written specification and to experiment with alternatives that can then be proposed to the ODMG-93 working group. Over the long term, he hopes to continue to track with extensions of the ODMG model as they occur.
This software fits the description in the U.S. Copyright Act of a "United States Government Work". This means it cannot be copyrighted. this software is freely available to the public for use without a copyright notice, and there are no restrictions on its use, now or subsequently.